package abstruct

import (
	"fmt"
	"time"
)

// 队列执行间隔
var NextTime = time.Second

// 队列不存在  休眠时间
var SleepTime = time.Second * 10

// 声明队列结构体
type QueueObj struct {
	Name string         `json:"name" comment:"队列名称"`
	Data map[string]any `json:"data" comment:"队列数据"`
}

// 处理队列名称
func QueueName(name string) string {
	if len(name) < 1 {
		name = "default"
	}

	return fmt.Sprintf("queue_%s", name)
}
